/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Alert;

import java.awt.Component;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

/**
 *
 * @author comiang
 */
public class MyTableCellRenderer extends DefaultTableCellRenderer { 
 
    @Override 
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { 
        MyTableModel model = (MyTableModel) table.getModel(); 
        Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); 
        c.setBackground(model.getRowColour(row)); 
        return c; 
    } 
} 

